package csy.view.memeda.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;

/**
 * Created by chengsiyuan on 2017/10/28.
 */

public class PracticeCircleView extends View {

    Paint paint1;
    Paint paint2;
    Paint paint3;
    Paint paint4;


    public PracticeCircleView(Context context) {
        super(context);

    }

    public PracticeCircleView(Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    public PracticeCircleView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public PracticeCircleView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        paint1 = new Paint();
        paint1.setColor(Color.BLACK);
        paint1.setStyle(Paint.Style.FILL);
        paint2 = new Paint();
        paint2.setColor(Color.BLACK);
        paint2.setStyle(Paint.Style.STROKE);
        paint3 = new Paint();
        paint3.setColor(Color.BLUE);
        paint3.setStyle(Paint.Style.FILL);
        paint4 = new Paint();
        paint4.setColor(Color.BLACK);
        paint4.setStyle(Paint.Style.STROKE);
        paint4.setStrokeWidth(20);
        canvas.drawCircle(300, 300, 200, paint1);
        canvas.drawCircle(700, 300, 200, paint2);
        canvas.drawCircle(300, 500, 200, paint3);
        canvas.drawCircle(500, 500, 200, paint4);
    }
}
